function count(str) {
  let obj = {};

  for (let i of str) {
    if (i === " ") {
      continue;
    }

    if (obj[i] == undefined) {
      obj[i] = 0;
    }
    obj[i]++;
  }

  return obj;
}
